		
		* Table A7
		* Joint Balancing Test

		clear all
		set more off
	
		use "C:\Users\EAsker\Desktop\ABR\data\ABR_final_data"
		************************************************************************
		*********************** Drop 2nd and 3rd quartiles *********************
		************************************************************************
		keep if survey==1988
		
		egen student_id=group(stu_id survey)
		sort student_id survey wave mot_hs fat_hs white black hispanic female fam_inc
		
		/* We need to observe a student once to obtain his 
		or her baseline characteristics. */
		
		duplicates drop student_id, force
		
		* Cleaning famlily income variable.
		
		replace fam_inc=. if fam_inc==99|fam_inc==97|fam_inc==0
		gen ln_fam_inc=log(fam_inc)
		
		/* Create a reform indicator (SFR): if the reform year is not missing, 
		the state implemented a school finance reform. */
		
		gen SFR=0
		replace SFR=1 if CSFR_year_BJH~=.
		
		label var SFR "Reform"
		
		********************
		* Dropping two middle income quartiles (Quartile 2 & 3) from the sample.
		
		drop if qrdinc80_b==2|qrdinc80_b==3
		
		local controls mot_hs fat_hs ln_fam_inc white black oth_race female
					
		reg  SFR `controls', cluster(fipst)
		
		outreg2 using "C:\Civic\ABR\output_2_15_24\Table_A7.xls", ///
		append ctitle(`y') addstat(F-Stat, e(F), P-value, e(p)) sdec(4) ///
		bdec(4) nonotes nocons keep(`controls') addtext(Quartile 1 and 4, YES) 
